home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-08-10 | 5.1 KB | 108 lines | [TEXT/MPS ] |
- /*
- TCPPB.h
- C definitions of parameter block entries needed for TCP calls
-
- Copyright Apple Computer, Inc. 1988-91
- All rights reserved
-
- */
-
-
- /* Command codes */
-
- #define TCPCreate 30
- #define TCPPassiveOpen 31
- #define TCPActiveOpen 32
- #define TCPSend 34
- #define TCPNoCopyRcv 35
- #define TCPRcvBfrReturn 36
- #define TCPRcv 37
- #define TCPClose 38
- #define TCPAbort 39
- #define TCPStatus 40
- #define TCPExtendedStat 41
- #define TCPRelease 42
- #define TCPGlobalInfo 43
- #define TCPCtlMax 49
-
- typedef enum TCPEventCode {
- TCPClosing = 1,
- TCPULPTimeout,
- TCPTerminate,
- TCPDataArrival,
- TCPUrgent,
- TCPICMPReceived,
- lastEvent = 32767
- } TCPEventCode;
-
- typedef enum TCPTerminationReason {
- TCPRemoteAbort = 2,
- TCPNetworkFailure,
- TCPSecPrecMismatch,
- TCPULPTimeoutTerminate,
- TCPULPAbort,
- TCPULPClose,
- TCPServiceError,
- lastReason = 32767
- } TCPTerminationReason;
-
- typedef pascal void (*TCPNotifyProc) (
- StreamPtr tcpStream,
- unsigned short eventCode,
- Ptr userDataPtr,
- unsigned short terminReason,
- struct ICMPReport *icmpMsg);
-
- typedef void (*TCPIOCompletionProc) (struct TCPiopb *iopb);
-
- typedef unsigned short tcp_port;
-
- typedef unsigned char byte;
-
- enum { /* ValidityFlags */
- timeoutValue = 0x80,
- timeoutAction = 0x40,
- typeOfService = 0x20,
- precedence = 0x10
- };
-
- enum { /* TOSFlags */
- lowDelay = 0x01,
- throughPut = 0x02,
- reliability = 0x04
- };
-
- typedef struct TCPCreatePB {
- Ptr rcvBuff;
- unsigned long rcvBuffLen;
- TCPNotifyProc notifyProc;
- Ptr userDataPtr;
- }TCPCreatePB;
-
- typedef struct TCPOpenPB {
- byte ulpTimeoutValue;
- byte ulpTimeoutAction;
- byte validityFlags;
- byte commandTimeoutValue;
- ip_addr remoteHost;
- tcp_port remotePort;
- ip_addr localHost;
- tcp_port localPort;
- byte tosFlags;
- byte precedence;
- Boolean dontFrag;
- byte timeToLive;
- byte security;
- byte optionCnt;
- byte options[40];
- Ptr userDataPtr;
- }TCPOpenPB;
-
- typedef struct TCPSendPB {
- byte ulpTimeoutValue;
- byte ulpTimeoutAction;
- byte validityFlags;
- Boolean pushFlag;
- Boolean urgentFlag;
- Ptr wdsPtr;
- unsigned